<template>
	<view id="container" :class="showMore?'tl-show':''" style="position: relative;"
		:style="isOther?'padding-bottom: 130rpx;':'padding-bottom: 10rpx;'">
		<!-- 圆圈按钮 -->
		<!-- #ifndef MP-WEIXIN -->
		<u-icon v-if="acTab && acTab.length>6 && winWidth<1000" @click="$refs['popList'].open()" name="list-dot" size="20" color="#fff"
			style="z-index: 99;padding: 10rpx;border-radius: 50%; position: fixed;top:120rpx;right: 20rpx;background-color: rgba(0,0,0,0.5);"
			:style="'top:'+120+'rpx'">
		</u-icon>
		<!-- #endif -->
		<!-- #ifdef MP-WEIXIN -->
		<view v-if="acTab && acTab.length>6 && winWidth<1000" @click="$refs['popList'].open()"
			style="position: fixed;top: 120rpx;right: 20rpx;background-color: rgba(0,0,0,0.5);padding: 10rpx;border-radius: 50%;z-index: 99;">
			<u-icon name="list-dot" size="20" color="#fff" style="z-index: 999;padding: 10rpx;border-radius: 50%;">
			</u-icon>
		</view>
		<!-- #endif -->
		<view v-if="acTab && acTab.length<=6"
			style="position: fixed;top: 0;left: 0;width: 750rpx;box-sizing: border-box;z-index: 999;">
			<view class="header-nav">
				<view class="nav-list u-flex" style="width: 750rpx;">
					<view @click="toPagePart(item.value,index)"
						:style="acTabIndex == index?'background-color: #F26C0C;':'background-color: #0080FF;'"
						class="nav-item"
						style="font-size: 26rpx; flex:1;text-align: center;line-height: 100rpx;color: #FFFFFF;"
						v-for="(item,index) in acTab" :key="index">
						{{item.name}}
					</view>
				</view>
			</view>
		</view>
		<!-- 轮播图 -->
		<view id="part1" class="swiper-box part1"
			:style="acTab && acTab.length>6 || winWidth<1000?'margin-top: 0rpx;':'margin-top: 100rpx;'"
			style="position: relative;margin: 0 auto;max-width: 2000rpx;max-height: 1320rpx;"
			v-if="swipList && swipList.length">
			<swiper class="swiper-item"
				:style="'height:'+winWidth*2*0.66+'rpx ;'" style="max-height: 1320rpx;" :circular="true"
				:indicator-dots="false" :autoplay="autoplay" :interval="3000" :duration="2000">
				<swiper-item
					@click="previewImg(swipList,index,'picPath','https://www.ydylmold.cn/images/ydylapp/usrMainPic/usrCompanyImage/')"
					v-for="(item,index) in swipList" :key="index">
					<image class="swiper-img" style="width: 100%;height: 100%;" :lazyLoad="true"
						:src="'https://www.ydylmold.cn/images/ydylapp/usrMainPic/usrCompanyImage/'+item.picPath"
						mode="widthFix"></image>
				</swiper-item>
			</swiper>
			<view class="bor-line" style="width: 100%;height: 10rpx;background-color: #EEEEEE;"></view>
		</view>
		<!-- 公司介绍 -->
		<view id="part2" class="part2" :style="'height:'+((winWidth*0.93*2)>680?(winWidth*0.93*2):680)+'rpx;'"
			style="max-height: 900rpx; max-width: 2000rpx;margin: 0 auto;"
			v-if="compInfo.introList && compInfo.introList.length">
			<view class="con-box u-flex u-flex-col u-col-center u-p-x-24 u-p-y-20" style="width: 100%;height: 100%;">
				<text class="title-text">公司介绍</text>
				<text class="title-sub">{{compInfo.introList && compInfo.introList[0] && compInfo.introList[0][0].subtitle || ''}}</text>
				<view class="list u-flex" style="width: 100%;height: 80%;">
					<swiper style="width: 100%;height: 100%;" :indicator-dots="false" :autoplay="true" :interval="3000"
						:duration="1000">
						<swiper-item style="width: 100%;height: 100%;" class="u-flex"
							v-for="(item,index) in compInfo.introList" :key="index">
							<view style="width: 33%;height: 100%;" class="list-item u-flex u-flex-col u-col-center"
								v-for="(item2,index2) in compInfo.introList[index]" :key="index2">
								<image @click="previewImg(item2.fileList)" style="width: 100%;height: 50%;"
									mode="aspectFill" :src="item2.fileList[0]">
								</image>
								<view style="height: 50%;" class="u-flex u-flex-col u-row-center u-col-center">
									<text class="item-title">{{item2.productName}}</text>
									<view :style="winWidth>600?'-webkit-line-clamp: 5;':'' " class="item-title-sub"
										@click="openPop(item2.remarks)">
										{{item2.remarks}}
									</view>
									<view @click="openPop(item2.subtitle)" :style="winWidth>600?'-webkit-line-clamp: 5;':'' " style="margin-top: 10rpx;" class="item-title-sub">
										{{item2.subtitle}}
									</view>
								</view>
							</view>
						</swiper-item>
					</swiper>
				</view>
			</view>
			<view class="bor-line" style="width: 100%;height: 10rpx;background-color: #EEEEEE;"></view>
		</view>
		<!-- 主打产品 -->
		<view id="part3" class="part3" :style="'height:'+((winWidth*0.74*2)>680?(winWidth*0.74*2):680)+'rpx;'"
			style="max-height: 800rpx; max-width: 2000rpx;margin: 0 auto;"
			v-if="compInfo.proList && compInfo.proList.length">
			<view class="u-flex u-col-top" style="height: 100%;">
				<view class="left-box" style="height: 100%;">
					<view class="nav-title">产品展示</view>
					<scroll-view scroll-y :scroll-top="(proIndex == 0?0:proIndex-1)*68"
						:style="'height:'+(winWidth*0.62*2)+'rpx;'" class="left-nav u-flex u-flex-col ">
						<view :class="{'nav-item-ac':proIndex == index}" class="nav-item"
							@click="proIndex = index,currProPage=1" v-for="(item,index) in compInfo.proList"
							:key="index">
							<text>{{item[0] && item[0][0] && item[0][0].subtitle}}</text>
						</view>
					</scroll-view>
				</view>
				<view class="right-img" style="flex: 1;position: relative;height: 100%;">
					<view class="img-box u-flex u-flex-wrap u-row-between u-col-top"
						style="width: 100%;height: 88%;position: absolute;top: 0;right: 0;"
						v-for="(item,index) in compInfo.proList[proIndex]" :key="index">
						<view v-for="(item2,index2) in compInfo.proList[proIndex][currProPage-1]" :key="index2"
							style="position: relative; width: 48%;height: 48%;">
							<image @tap="previewImg((item2 && item2.fileList) || [])" style="width: 100%;height: 100%;"
								mode="aspectFill" :src="item2 && item2.fileList && item2.fileList[0]"></image>
							<view class="line-one"
								style="font-size: 28rpx; position: absolute;bottom: 0;text-align: center;background-color: rgba(0, 0, 0, 0.45);width: 100%;color: #FFFFFF;">
								{{item2.productName}}
							</view>
						</view>
						<view class="u-flex"
							style="position: absolute; bottom: -100rpx;left: 50%; margin-left: -150rpx; display: flex;align-items: center;justify-content: center;margin-bottom: 30rpx;">
							<image @click="changePagePro(1,compInfo.proList[proIndex].length)" style="width: 60rpx;"
								src="https://job.ydylmold.cn/mingpian/image/comIndex/circle1.png" mode="widthFix">
							</image>
							<view class="u-flex" style="margin: 0 30rpx;font-size: 24rpx;">
								<text>{{currProPage}}</text>
								<text style="margin: 0 30rpx;">/</text>
								<text>{{compInfo.proList[proIndex].length}}</text>
							</view>
							<image @click="changePagePro(2,compInfo.proList[proIndex].length)" style="width: 60rpx;"
								src="https://job.ydylmold.cn/mingpian/image/comIndex/circle2.png" mode="widthFix">
							</image>
						</view>
					</view>
				</view>
			</view>
			<view class="bor-line" style="width: 100%;height: 10rpx;background-color: #EEEEEE;"></view>
		</view>
		<!-- 选择我们的理由 -->
		<view id="part4" class="part4" style="max-width: 2000rpx;margin: 0 auto;"
			v-if="compInfo.reasonList && compInfo.reasonList.length">
			<view class="con-box u-flex u-flex-col u-col-center u-p-x-24 u-p-y-20">
				<view class="title-text">选择我们的<text style="color:#EB6100;">{{compInfo.reasonList.length}}</text>个理由
				</view>
				<text class="title-sub">{{compInfo.reasonList[0].subtitle}}</text>
				<view class="list" style="width: 100%;">
					<view class="list-item u-flex u-col-top" style="width: 100%;"
						v-for="(item,index) in compInfo.reasonList" :key="index">
						<view class="imb-box u-flex u-flex-col"
							:style="index!=compInfo.reasonList.length-1?'border-right: 5rpx solid #304CE5;':''"
							style="width: 50%;height: 280rpx;position: relative;padding: 0rpx 40rpx 30rpx 40rpx;">
							<view class="u-flex u-flex-col u-col-center" v-if="index%2 == 0">
								<text class="info-title">{{item.productName}}</text>
								<text class="info-title-sub" @click="openPop(item.remarks)">{{item.remarks}}</text>
							</view>
							<u-image
								@click="previewImg(['https://www.ydylmold.cn/file/getPlayResource/136/'+item.imgName])"
								v-else width="250rpx" height="220rpx" mode="aspectFill"
								:src="'https://www.ydylmold.cn/file/getPlayResource/136/'+item.imgName">
							</u-image>
							<view class="num-text">{{index<10?'0'+(index+1):index+1}}</view>
						</view>
						<view class="info-box u-flex u-flex-col" style="padding:0 40rpx;width: 50%;">
							<view class="u-flex u-flex-col u-col-center" v-if="index%2 != 0">
								<text class="info-title">{{item.productName}}</text>
								<text class="info-title-sub" @click="openPop(item.remarks)">{{item.remarks}}</text>
							</view>
							<u-image
								@click="previewImg(['https://www.ydylmold.cn/file/getPlayResource/136/'+item.imgName])"
								v-else width="250rpx" height="220rpx" mode="aspectFill"
								:src="'https://www.ydylmold.cn/file/getPlayResource/136/'+item.imgName">
							</u-image>
						</view>
					</view>
				</view>
			</view>
			<view class="bor-line" style="width: 100%;height: 10rpx;background-color: #EEEEEE;"></view>
		</view>
		<!-- 公司资质 -->
		<view id="part5" class="part5 con-part2 u-flex u-flex-col u-col-center"
			:style="'height:'+((winWidth*0.96*2)>680?(winWidth*0.96*2):680)+'rpx;'"
			style="max-height: 900rpx; max-width: 2000rpx;margin: 0 auto;"
			v-if="compInfo.videoInfo && compInfo.videoInfo.length">
			<view class="part5-title">公司资质</view>
			<view class="part5-title-sub">{{compInfo.videoInfo[0].subtitle}}</view>
			<view class="part5-info" style="justify-content: flex-end;flex:1;width: 100%;">
				<scroll-view :scroll-x="true" style="width: 100%;" :scroll-left="toLeft">
					<view style=" display: flex;align-items: center;"
						:style="'width:' +(compInfo.videoInfo.length*210)+'rpx;'">
						<view style="width: 200rpx;margin-right: 10rpx;" @click="selectVideo(item,index)"
							class="span-text one-line"
							:style="currVideo==index?'background-color:#304CE5;':'background-color: #a8a8a8;'"
							v-for="(item,index) in compInfo.videoInfo" :key="index">
							{{item.productName}}
						</view>
					</view>
				</scroll-view>
				<view class="u-flex u-col-top" style="width: 100%;height: 84%;">
					<view v-if="acvideoInfo && acvideoInfo.imgName" class="info1 u-flex u-flex-col u-col-top"
						style="margin-right: 20rpx;width: 30%;height: 80%;">
						<view class="img-box" style="width: 100%;height: 80%;"
							v-if="acvideoInfo && acvideoInfo.imgName">
							<image style="width: 100%;margin-bottom: 30rpx;height: 70%"
								v-for="(item,index) in acvideoInfo.imgName.split(',')" :key="index"
								:src="'https://www.ydylmold.cn/file/getPlayResource/140/'+ item"
								@click="previewImg(['https://www.ydylmold.cn/file/getPlayResource/140/'+ item])"
								mode="aspectFill">
							</image>
						</view>
					</view>
					<video style="flex: 1;height: 100%;" id="myVideo"
						:src="'https://www.ydylmold.cn/file/getPlayResource/173/'+ (acvideoInfo && acvideoInfo.productVideo)"
						enable-danmu controls></video>
				</view>
			</view>
		</view>
		<!-- 客户案例 -->
		<view id="part6" style="max-width: 2000rpx;margin: 0 auto;"
			class="part6 u-flex u-flex-col u-col-center u-m-b-20" v-if="compInfo.useCase && compInfo.useCase.length">
			<text class="title-text">客户应用案例</text>
			<text class="title-sub">{{compInfo.useCase && compInfo.useCase[0] && compInfo.useCase[0].subtitle}}</text>
			<swiper :circular="true" style="height: 710rpx;width: 100%;margin-top: 30rpx;" :indicator-dots="false"
				:autoplay="true" :interval="10000" :duration="1000">
				<swiper-item v-for="(item,index) in compInfo.useCase" :key="index">
					<u-image class="con-img" width="100%" height="450rpx" :lazyLoad="true"
						:src="'https://www.ydylmold.cn/images/ydylapp/usrCompanyStation/applicationsImage/'+item.imgName"
						mode="aspectFill"
						@click="previewImg(['https://www.ydylmold.cn/images/ydylapp/usrCompanyStation/applicationsImage/'+item.imgName])">
					</u-image>
					<view class="swiper-span">
						<view class="u-flex u-row-between">
							<view class="span-title">{{item.productName}}</view>
							<view class="read-more" @click="openPop(item.remarks)">阅读更多</view>
						</view>
						<view class="con-text">
							<view class="span-con">{{item.remarks}}</view>
						</view>
					</view>
				</swiper-item>
			</swiper>
		</view>
		<!-- 公司新闻 -->
		<view id="part7" style="max-width: 2000rpx;margin: 0 auto;" class="part7">
			<text class="page-title" style="color: #FFFFFF;">公司新闻</text>
			<view class="u-flex u-row-between">
				<view class="part7-left">
					<text class="news-title">公司新闻/</text>
					<view class="news-list">
						<view class="news-item" @click="toUrl(`/pages/newsPart/index/newsDetail?newsId=${item.id}`)"
							v-for="(item,index) in newsList.slice(0,5)" :key="index">
							{{item.from=='portal'?'(推荐)'+item.title:item.title}}
						</view>
					</view>
				</view>
				<view class="part7-right">
					<text class="news-title">行业新闻/</text>
					<view class="news-list">
						<view class="news-item" @click="toUrl(`/pages/newsPart/index/newsDetail?newsId=${item.id}`)"
							v-for="(item,index) in newsList.slice(5,10)" :key="index">
							{{item.title}}
						</view>
					</view>
				</view>
			</view>
			<view @click="toUrl('/pages/newsPart/index/index')" class="u-flex u-row-center u-m-t-20 u-font-28" style="color: #fff;">
				<text >查看更多</text>
				<u-icon name="arrow-right" color='#fff'></u-icon>
			</view>
		</view>
		<!-- 关于我们 -->
		<view class="part8" style="max-width: 2000rpx;margin: 0 auto;" v-if="compInfo.aboutInfo.remarks">
			<text class="page-title" style="color:#EB6100;">关于我们</text>
			<view class="about-cont" style="margin-top: 30rpx;">
				{{compInfo.aboutInfo && compInfo.aboutInfo.remarks && compInfo.aboutInfo.remarks.slice(0,110)}}
				<text class="read-more" @click="openPop(compInfo.aboutInfo.remarks)"
					v-if="compInfo.aboutInfo.remarks && compInfo.aboutInfo.remarks.length>110">阅读更多</text>
			</view>
		</view>
		<!-- 将您的信息发送给我们 -->
		<view v-if="isOther" class="con-box u-flex u-flex-col"
			style="max-width: 2000rpx;margin: 0 auto;background-color: #F5F5F5;padding: 30rpx 34rpx;box-sizing: border-box;width: 750rpx;">
			<text style="font-size: 28rpx;">将您的信息发送给我们</text>
			<u-form style="width: 100%;" labelPosition="left" :model="model1" ref="uForm">
				<u-form-item labelWidth="80" required label="联系方式" prop="userInfo.fromNo" borderBottom ref="fromNo">
					<u--input style="background-color: #FFFFFF;height: 80rpx;padding: 0 20rpx;"
						v-model="model1.userInfo.fromNo" border="none" placeholder="请输入您的电子邮件或者电话号码"></u--input>
				</u-form-item>
				<u-form-item labelWidth="80" required label="标题" prop="userInfo.title" borderBottom ref="title">
					<u--input style="background-color: #FFFFFF;height: 80rpx;padding: 0 20rpx;"
						v-model="model1.userInfo.title" border="none" placeholder="请填写标题"></u--input>
				</u-form-item>
				<u-form-item labelWidth="80" required label="内容" prop="userInfo.content" borderBottom ref="content">
					<textarea style="width: 100%;background-color: #FFFFFF;border-radius: 10rpx;padding: 10rpx 20rpx;"
						placeholder-class="place-class" v-model="model1.userInfo.content"
						placeholder="建议您在这里说说您的产品要求和公司信息"></textarea>
				</u-form-item>
			</u-form>
			<button type="primary" style="width: 650rpx;font-size: 26rpx;margin-top: 20rpx;"
				@click="sendData">发送</button>
		</view>
		<!-- 咨询 -->
		<view class="footer" id="part8" style="margin: 0 auto;max-width: 2000rpx;">
			<view class="infotion u-flex u-flex-col u-col-top">
				<view class="info">
					<view>
						<image class="infoImage" src="https://job.ydylmold.cn/mingpian/image/me//phone.png"></image>
					</view>
					<view>
						<view>联系人：{{shareName || compData.linker || ''}}</view>
						<view @click="callPeo()">电话：{{sharePhone || compData.phone}}
						</view>
					</view>
				</view>
				<view class="info" v-if="compData.email || shareEmail">
					<view>
						<image class="infoImage" src="https://job.ydylmold.cn/mingpian/image/me//email.png"></image>
					</view>
					<view>邮箱：{{shareEmail || compData.email || ''}}</view>
				</view>
				<view class="info">
					<view>
						<image class="infoImage" src="https://job.ydylmold.cn/mingpian/image/me//address.png"></image>
					</view>
					<view>地址：{{(compData.cityName || '')+' '+(compData.addr || '')}}</view>
				</view>
			</view>
			<text class="part6-bom-text">版权所有©{{compData.companyNameCn || ''}}</text>
		</view>
		
		<!-- 操作按钮 -->
		<my-button :useNum="companyId" :acPhone="compData.phone" :isShare="isShare" :isOther="isOther"></my-button>
		<u-popup @close="showTextPop = false" :show="showTextPop" closeable mode="center" round="30">
			<scroll-view scroll-y
				style="width: 650rpx;height: 80vh;padding:60rpx 30rpx 30rpx 30rpx;line-height: 46rpx;">
				<view class="pop-box">
					<view>{{acText}}</view>
				</view>
			</scroll-view>
		</u-popup>
		<uni-popup type="right" ref="popList">
			<view class="list-box" style=" width: 550rpx;background-color: #FFFFFF;line-height: 100rpx;height: 100%;">
				<view class="con-list">
					<view @click="toPagePart(item.value,index)" v-for="(item,index) in acTab" :key="index"
						style="border-bottom: 1rpx solid #EEEEEE;text-align: center;">{{item.name}}</view>
				</view>
				<view class="moreSet con-list" v-if="useState.isMyFriend && !useState.inMyList && isOther">
					<view style="background-color: #808080;color: #fff;text-align: center;">更多操作</view>
					<view @click="selectItem(item)" v-for="(item,index) in stateList" :key="index"
						style="color:#4299db ;border-bottom: 1rpx solid #EEEEEE;text-align: center;">{{item.name}}
					</view>
				</view>
			</view>
		</uni-popup>
		<my-auth-modal></my-auth-modal>
	</view>
</template>
<script>
	import {
		queryPicList,
		queryUsrMainPicNum,
		queryUsrCompanyStationList,
		queryNewForCom
	} from '@/common/api/auth.js'
	import {
		usrCompanyMessageInsert
	} from '@/common/api/msg.js'
	import {
		mapGetters
	} from "vuex";
	import {
		callPeople
	} from '@/utils/common.js'
	import {
		getToken,
		setToken
	} from '@/utils/token.js'
	// #ifdef MP-WEIXIN
	import {
		shareMixins
	} from '@/mixins/share'
	// #endif
	export default {
		// #ifdef MP-WEIXIN
		mixins: [shareMixins],
		// #endif
		props: ['isShare', 'shareEmail', 'sharePhone', 'shareName', 'compId', 'hasLeft','isOther'],
		data() {
			return {
				shareData: {
					title: '名片王'
				},
				autoplay: true,
				showMore: false,
				compInfo: {
					proList: [], //产品数组1
					videoInfo: [], //品质保证7
					useCase: [], //客户案例5
					aboutInfo: {}, //关于我们10
					introList: [], //公司介绍6
					reasonList: [] //选择理由3
				},
				newsList: [], //公司新闻
				swipList: [], //轮播图
				compData: {},
				acText: '',
				showTextPop: false,
				showAllPro: false,
				companyId: '',
				title: '更多操作',
				showMask: false,
				version: getToken('version'),
				model1: {
					userInfo: {
						sendNo: getToken('useNum'), //发送人
						receiveNo: '', //接收人
						sendType: getToken('version') == 1 ? 0 : 1, //公司名
						receiveType: 1, //电话
						fromType: 1,
						fromNo: '', //联系方式
						title: '', //标题
						content: '', //内容
					},
				},
				currProPage: 1,
				allProData: [],
				tabList: [{
					name: '首页',
					value: 1
				}, {
					name: '公司介绍',
					value: 2
				}, {
					name: '主打产品',
					value: 3
				}, {
					name: '选择理由',
					value: 4
				}, {
					name: '公司资质',
					value: 5
				}, {
					name: '客户案例',
					value: 6
				}, {
					name: '公司新闻',
					value: 7
				}, {
					name: '关于我们',
					value: 8
				}],
				acTab: [],
				windowUrl: getToken('windowUrl'),
				acTabIndex: 0,
				proIndex: 0,
				winWidth: 0,
				acvideoInfo: {}, //当前选中的公司资质
				toLeft: 0,
				currVideo: 0
			}
		},
		computed: {
			...mapGetters(['useState', 'isLogin', 'isFresh', 'stateList']),
		},
		// 触发下拉刷新
		onPullDownRefresh() {
			this.init()
			// 延迟关闭刷新动画
			setTimeout(() => {
				uni.stopPullDownRefresh();
			}, 1000);
		},
		created: function() {
			this.winWidth = uni.getSystemInfoSync().windowWidth
			if (this.compId) {
				this.companyId = this.compId
			} else {
				this.companyId = getToken('useNum')
			}
			this.init()
			
		},
		methods: {
			
			selectVideo(item, index) {
				this.currVideo = index
				this.acvideoInfo = item
				this.toLeft = index * 210
			},
			changePagePro(type, allPage) {
				if (type == 1 && this.currProPage != 1) {
					this.currProPage--
				} else if (type == 2 && this.currProPage != allPage) {
					this.currProPage++
				}
			},
			//跳到对应的锚点
			toPagePart(partId, index) {
				this.acTabIndex = index
				let channelIdStr = '#part' + partId;
				// #ifdef MP-WEIXIN
				this.createSelectorQuery().select(channelIdStr).boundingClientRect(data => {
					this.createSelectorQuery().select("#container").boundingClientRect(res => {
						uni.pageScrollTo({
							duration: 100, //过渡时间
							scrollTop: data.top - res.top - 100, //到达距离顶部的top值
						})
						this.$refs['popList'].close()
					}).exec();
				}).exec();
				// #endif
				// #ifndef MP-WEIXIN
				uni.createSelectorQuery().select(channelIdStr).boundingClientRect(data => { //目标位置的节点：类或者id
					uni.createSelectorQuery().select("#container").boundingClientRect(res => { //最外层盒子的节点：类或者id
						uni.pageScrollTo({
							duration: 100, //过渡时间
							scrollTop: data.top - res.top - 60, //到达距离顶部的top值
						})
						this.$refs['popList'].close()
					}).exec()
				}).exec();
				// #endif
			},
			toMoreNews() {
				uni.navigateTo({
					url: '/pages/newsPart/index/index'
				})
			},
			sendData() {
				if (!getToken('isLogin')) {
					this.$store.dispatch('showAuthModal');
					return
				}
				let acData = this.model1.userInfo
				if (!acData.fromNo) {
					this.$u.toast('请填写联系方式')
				} else if (!this.$u.test.mobile(acData.fromNo) && !this.$u.test.email(acData.fromNo)) {
					this.$u.toast('请填写正确的电话或邮箱')
				} else if (!acData.title) {
					this.$u.toast('请填写标题')
				} else if (!acData.content) {
					this.$u.toast('请填写内容')
				} else {
					acData.receiveNo = this.companyId
					usrCompanyMessageInsert(acData).then(res => {
						if (res.data && res.data.code == 1) {
							this.$u.toast('提交成功')
							this.model1.userInfo = {
								sendNo: getToken('useNum'), //发送人
								receiveNo: '', //接收人
								sendType: 0, //公司名
								receiveType: 1, //电话
								fromType: 1,
								fromNo: '', //联系方式
								title: '', //标题
								content: '', //内容
							}
						}
					})
				}
			},
			clickRightNav() {
				this.$store.commit('getStateList')
				if (this.stateList && this.stateList.length) {
					this.showMask = true
				}
			},
			selectItem(e) {
				switch (e.name) {
					case '加入黑名单':
						this.$store.dispatch('usrBlackListInsert', this.companyId)
						break
					case '删除好友':
						this.$store.dispatch('delFriends', this.companyId)
						break
				}
			},
			callPeo() {
				callPeople(this.companyId, this.compData.phone, this.isShare)
			},
			previewImg(arr, index, key, head) {
				//console.log(arr)
				if (key) {
					arr = arr.map(v => {
						return head ? (head + v[key]) : v[key]
					})
				}
				uni.previewImage({
					current: index || 0,
					urls: arr
				})
			},
			openPop(text) {
				this.acText = text
				this.showTextPop = true
			},
			// 初始化数据
			init() {
				this.compInfo = {
					proList: [], //产品数组1
					videoInfo: [], //品质保证7
					useCase: [], //客户案例5
					aboutInfo: {}, //关于我们10
					introList: [], //公司介绍6
					reasonList: [] //选择理由3
				}
				this.acTab = []
				//获取企业轮播图、轮播图数量、企业认证状态、企业更多资料
				Promise.all([
					this.queryPicList(),
					this.queryUsrCompanyStationList(),
					this.searchOneNew(),
					this.queryNewForCom()
				]).then(([
					res1, res2, res3, res4 = []
				]) => {
					if (res1.statusCode == 200) {
						this.swipList = res1.data
						if (this.swipList && this.swipList.length) {
							this.acTab.push(this.tabList[0])
						}
					}
					if (res2.data && res2.data.code == 1) {
						let acInfo = {}
						// 数组分类
						let data = res2.data && res2.data.listData
						data = data.filter(v => {
							return v.state == 1
						})
						data && data.forEach(m => {
							if (m.state) {
								switch (m.stationType) {
									case 1: //产品展示
										this.compInfo.proList.push(m)
										break;
									case 3: //选择理由
										this.compInfo.reasonList.push(m)
										break;
									case 5: //客户案例
										this.compInfo.useCase.push(m)
										break;
									case 6: //公司介绍
										m.fileList = m.imgName.split(',').map(v => {
											return 'https://www.ydylmold.cn/file/getPlayResource/139/' +
												v
										})
										this.compInfo.introList.push(m)
										break;
									case 7: //品质保证
										this.compInfo.videoInfo.push(m)
										break;
									case 10: //关于我们
										this.compInfo.aboutInfo = m
										break;
								}
							}
						})
						if (this.compInfo.proList && this.compInfo.proList.length) { //主打产品
							this.acTab.push(this.tabList[2])
						}
						if (this.compInfo.introList && this.compInfo.introList.length) {
							this.acTab.push(this.tabList[1])
							let arr1 = []
							let arr2 = this.compInfo.introList
							for (var i = 0, j = arr2.length; i < j; i += 3) {
								arr1.push(arr2.slice(i, i + 3));
							}
							this.compInfo.introList = arr1
						}
						if (this.compInfo.reasonList && this.compInfo.reasonList.length) {
							this.acTab.push(this.tabList[3])
						}
						if (this.compInfo.videoInfo && this.compInfo.videoInfo.length) {
							this.acTab.push(this.tabList[4])
							this.acvideoInfo = this.compInfo.videoInfo[0]
						}
						if (this.compInfo.useCase && this.compInfo.useCase.length) {
							this.acTab.push(this.tabList[5])
						}
						let proList = this.compInfo.proList
						proList && proList.forEach((pro, idx) => {
							if (pro.imgName) {
								pro.sendImg = pro.imgName.split(',')
								pro.fileList = pro.imgName.split(',').map(v => {
									return 'https://www.ydylmold.cn/images/ydylapp/usrCompanyStation/mainProductsImage/' +
										v
								})
							}
							if (!pro.subtitle) {
								pro.subtitle = '其他分类'
							}
						})
						//产品数组按照子标题分类
						let arr1 = proList.reduce((acc, obj) => {
							let key = obj['subtitle']
							if (!acc[key]) {
								acc[key] = []
							}
							acc[key].push(obj)
							return acc
						}, {})
						let arr2 = []
						for (let key in arr1) {
							arr2.push(arr1[key])
						}
						let arr3 = []
						arr2.forEach(item => {
							//产品数组按照4个分类
							if (item && item.length) {
								let allProList = item
								item.allProPage = Math.ceil((allProList.length) / 4)
								let result = []
								for (var i = 0, j = allProList.length; i < j; i += 4) {
									result.push(allProList.slice(i, i + 4));
								}
								arr3.push(result)
							}
						})
						this.compInfo.proList = arr3
						//console.log(arr3, '产品数组')
					}
					if (res3.companyId) {
						this.compData = res3
						uni.setNavigationBarTitle({
							title: this.compData.companyNameCn
						})
					}
					if (res4.data && res4.data.code == 1) {
						this.newsList = res4.data.data
						if (this.newsList && this.newsList.length) {
							this.acTab.push(this.tabList[6])
						}
					}
					this.acTab.push(this.tabList[7])
				})
			},
			queryNewForCom() {
				return queryNewForCom({
					companyId: this.companyId,
					'page.size': 6
				})
			},
			//查找轮播图
			queryPicList() {
				if(this.companyId)
				return queryPicList({
					companyNo: this.companyId,
					moduleNo: 'ydylapp1001',
					isType: 0
				})
			},
			//公司更多数据详情
			queryUsrCompanyStationList() {
				return queryUsrCompanyStationList({
					companyNo: this.companyId
				})
			},
			// 轮播图梳数量
			queryUsrMainPicNum() {
				return queryUsrMainPicNum({
					companyNo: this.companyId,
					moduleNo: 'ydylapp1001'
				})
			},
			//查询公司认证状态
			searchOneNew() {
				console.log('cccccccccccccccc');
				return this.$store.dispatch('searchOneNew', {
					userId: this.companyId,
					isShare: this.isShare
				})
			},
			getRandomColor: function() {
				const rgb = []
				for (let i = 0; i < 3; ++i) {
					let color = Math.floor(Math.random() * 256).toString(16)
					color = color.length == 1 ? '0' + color : color
					rgb.push(color)
				}
				return '#' + rgb.join('')
			},
			
			toUrl(url) {
				uni.navigateTo({
					url: url
				})
			}
		}
	}
</script>
<style lang="scss" scoped>
	.tl-show {
		overflow: hidden;
		position: fixed;
		height: 100%;
		width: 100%;
	}

	// 公共
	.place-class {
		color: rgb(192, 196, 204);
	}

	.seeMore {
		line-height: 31rpx;
		font-size: 32rpx;
		font-family: PingFang SC;
		font-weight: bold;
		color: #969799;
		text-align: center;
		display: block;
	}

	.page-title {
		font-size: 38rpx;
		color: rgba(0, 0, 0, 1);
		text-align: center;
		line-height: 110rpx;
		text-align: center;
		display: block;
		font-weight: bold;
	}

	// 头部
	.cen-img {
		width: 60rpx;
		height: 60rpx;
		border-radius: 50%;
	}

	.nav-left-text {
		font-size: 30rpx;
		font-family: PingFang SC;
		font-weight: bold;
		color: #333333;
	}

	.con-box {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 100%;
	}

	.cen-text {
		font-size: 28rpx;
		margin-left: 18rpx;
		font-family: PingFang SC;
		font-weight: bold;
		color: #333333;
		width: 400rpx;
		white-space: nowrap;
		text-overflow: ellipsis;
		overflow: hidden;
		text-align: center;
	}

	.more-img {
		width: 42rpx;
		height: 32rpx;
		margin-left: 50rpx;
	}

	// 轮播图
	.part1 {
		position: relative;
		width: 750rpx;
		/* #ifdef MP-WEIXIN */
		padding-top: 100rpx;

		/* #endif */
		.swiper-img {
			width: 750rpx;
			height: 500rpx;
		}

		.stext-span {
			width: 750rpx;
			height: 100rpx;
			line-height: 100rpx;
			text-align: center;
			background: #3148D1;
			font-size: 28rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: #FFFFFF;
			position: absolute;
			bottom: 0;
		}

		.jian-left,
		.jian-right {
			width: 50rpx;
			height: 120rpx;
			z-index: 99;
			top: 140rpx;
			position: absolute;
		}

		.jian-left {
			left: 0;
		}

		.jian-right {
			right: 0;
		}
	}

	//公司介绍
	.part2 {
		width: 750rpx;

		.title-text {
			font-size: 38rpx;
			color: #EB6100;
			line-height: 110rpx;
			font-weight: bold;
		}

		.title-sub {
			line-height: 50rpx;
			font-size: 26rpx;
			color: #304CE5;
			text-align: center;
		}

		.list {
			margin-top: 20rpx;
			width: 100%;

			.list-item {
				width: 33.333%;
				margin: 20rpx 10rpx;
				padding-bottom: 30rpx;
				box-sizing: border-box;
				border-bottom: 5rpx solid #304CE5;

				image {
					width: 100%;
				}

				.item-title {
					font-size: 32rpx;
					font-weight: bold;
					line-height: 100rpx;
				}

				.item-title-sub {
					// height: 180rpx;
					overflow: hidden;
					text-overflow: ellipsis;
					display: -webkit-box;
					-webkit-line-clamp: 2;
					-webkit-box-orient: vertical;
					line-height: 36rpx;
					font-size: 26rpx;
					color: #666;
				}
			}
		}
	}

	// 主打产品
	.part3 {
		background-color: #EEEEEE;
		width: 100%;
		// height: 600rpx;
		padding: 10rpx 18rpx 10rpx 20rpx;
		box-sizing: border-box;
		font-size: 26rpx;

		.left-box {
			background-color: #FFFFFF;
			height: 100%;
			width: 28%;
			max-width: 400rpx;
			margin-right: 20rpx;

			.left-nav {
				height: 100%;
			}

			.nav-title {
				background-color: #EB6100;
				color: #FFFFFF;
				line-height: 68rpx;
				width: 100%;
				text-align: center;
			}

			.nav-item {
				border-bottom: 1rpx solid #EB6100;
				line-height: 68rpx;
				width: 100%;
				text-align: center;
			}

			.nav-item-ac {
				line-height: 78rpx;
				background-color: #304CE5;
				border-bottom: none;
				color: #FFFFFF;
				width: 100%;
				text-align: center;
				font-size: 30rpx;
				font-weight: bold;
			}
		}
	}

	//选择我们的理由
	.part4 {
		width: 750rpx;

		.title-text {
			font-size: 38rpx;
			font-weight: bold;
			line-height: 110rpx;
		}

		.title-sub {
			line-height: 50rpx;
			font-size: 26rpx;
			color: #304CE5;
			text-align: center;
		}

		.list {
			margin-top: 40rpx;
		}

		.info-title {
			font-size: 30rpx;
			font-weight: bold;
			line-height: 60rpx;
		}

		.info-title-sub {
			overflow: hidden;
			text-overflow: ellipsis;
			display: -webkit-box;
			-webkit-line-clamp: 5;
			-webkit-box-orient: vertical;
			font-size: 24rpx;
			line-height: 36rpx;
			color: #666;
		}

		.num-text {
			position: absolute;
			top: 0;
			right: -30rpx;
			width: 58rpx;
			height: 58rpx;
			border-radius: 50%;
			font-size: 30rpx;
			color: #FFFFFF;
			text-align: center;
			line-height: 58rpx;
			font-weight: bold;
			background-color: #304CE5;
		}
	}

	//公司资质
	.part5 {
		background-color: #242424;
		color: #FFFFFF;
		box-sizing: border-box;
		padding: 40rpx 20rpx 30rpx 20rpx;

		.part5-title {
			font-size: 38rpx;
			text-align: center;
			font-weight: bold;
		}

		.part5-title-sub {
			text-align: center;
			font-size: 26rpx;
			line-height: 50rpx;
		}

		.span-text {
			margin-top: 20rpx;
			width: 200rpx;
			text-align: center;
			font-size: 28rpx;
			margin-bottom: 20rpx;
			line-height: 66rpx;
			background-color: #304CE5;
		}
	}

	//客户案例
	.part6 {
		.title-text {
			font-size: 38rpx;
			color: #EB6100;
			line-height: 110rpx;
			font-weight: bold;
		}

		.title-sub {
			line-height: 50rpx;
			font-size: 26rpx;
			color: #304CE5;
			text-align: center;
		}

		.con-img {
			width: 100%;
			height: 450rpx;
		}

		.swiper-span {
			padding: 30rpx 10rpx 25rpx 32rpx;
			box-sizing: border-box;
			display: flex;
			flex-direction: column;
			height: 260rpx;
			background-color: #F5F5F5;
		}

		.span-title {
			// line-height: 28rpx;
			font-size: 34rpx;
			font-family: PingFang SC;
			font-weight: 800;
			color: #333333;
			margin-bottom: 10rpx;
			font-size: 34rpx;
		}

		.span-con,
		.span-see-more {
			font-size: 30rpx;
			font-family: PingFang SC;
			font-weight: 400;
			color: #A8A8A8;
			overflow: hidden;
			text-overflow: ellipsis;
			display: -webkit-box;
			-webkit-line-clamp: 4;
			-webkit-box-orient: vertical;
			line-height: 40rpx;
		}

		.span-see-more {
			color: #3148D1;
		}
	}

	// 公司新闻
	.part7 {
		background-image: url('https://job.ydylmold.cn/mingpian/image/comIndex/aboutAs.png');
		width: 750rpx;
		min-height: 580rpx;
		background-size: cover;
		margin-top: 20rpx;

		.part7-left,
		.part7-right {
			flex: 1;
			padding: 0 10rpx;
			margin-top: 30rpx;
		}

		.news-title {
			background-color: #3148D1;
			color: #FFFFFF;
			font-size: 32rpx;
			font-weight: bold;
			padding: 8rpx 20rpx;
		}

		.news-list {
			margin-top: 30rpx;
			width: 100%;
			min-height: 300rpx;
			background-color: rgba($color: #888, $alpha: 0.8);
			padding: 10rpx;

			.news-item {
				color: #FFFFFF;
				font-size: 28rpx;
				line-height: 56rpx;
				text-overflow: ellipsis;
				overflow: hidden;
				width: 330rpx;
				white-space: nowrap;
			}
		}
	}

	// 关于我们
	.part8 {
		padding: 0 32rpx 32rpx 32rpx;

		.about-title {
			// line-height: 61rpx;
			font-size: 64rpx;
			font-family: PingFang SC;
			padding: 120rpx 0 78rpx 34rpx;
			display: block;
			text-align: center;
		}

		.about-cont {
			display: block;
			font-size: 28rpx;
			font-family: PingFang SC;
			margin-bottom: 40rpx;
			line-height: 40rpx;
		}
	}

	.read-more {
		font-size: 26rpx;
		font-family: PingFang SC;
		color: #FF6600;
		padding-left: 34rpx;
	}

	//底部
	.footer {
		width: 750rpx;
		// height: 300rpx;
		background: #797778;
		display: flex;
		align-items: center;
		position: relative;
		padding: 30rpx 34rpx 90rpx 34rpx;
		box-sizing: border-box;

		.part6-title {
			font-size: 30rpx;
			font-family: PingFang SC;
			font-weight: bold;
			color: #FFFFFF;
		}

		.part6-rigth,
		.part6-left {
			display: flex;
			flex-direction: column;
			justify-content: space-between;
			height: 100%;
		}

		.part6-rigth {
			width: 350rpx;
		}

		.part6-rigth-text {
			font-size: 30rpx;
			font-family: PingFang SC;
			font-weight: bold;
			color: #CFCFCF;
			margin-top: 12rpx;
		}

		.part6-left-text {
			font-size: 24rpx;
			font-family: PingFang SC;
			font-weight: bold;
			color: #CFCFCF;
		}

		.part6-bom-text {
			font-size: 24rpx;
			font-family: PingFang SC;
			font-weight: bold;
			color: #CFCFCF;
			position: absolute;
			bottom: 0;
			left: 0;
			width: 100%;
			padding: 12rpx 0;
			background-color: #6A6A6A;
			text-align: center;
		}

		.infotion {
			display: flex;
			justify-content: space-between;
			flex-wrap: wrap;
			font-size: 26rpx;
			font-family: PingFang SC;
			font-weight: bold;
			color: #CFCFCF;
		}

		.info {
			display: flex;
			margin-top: 10rpx;
			// background-color: palegoldenrod;
			align-items: center;

			.infoImage {
				width: 60rpx;
				height: 60rpx;
				margin-right: 10rpx;
				background-color: white;
				border-radius: 50rpx;
				border: 1rpx solid #D81E06;
			}
		}
	}
</style>
